package de.kiltz.foo.mvc;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;

import de.kiltz.foo.domain.Foo;

public class NeuValidator implements Validator 
{
    

        /** Logger for this class and subclasses */
        protected final Log logger = LogFactory.getLog(getClass());

        public boolean supports(Class clazz) {
            return clazz.equals(Foo.class);
        }

        public void validate(Object obj, Errors errors) {
        	String[] plichtFelder = {"text", "zahl" };
        	for (int i = 0; i < plichtFelder.length; i++) {
                ValidationUtils.rejectIfEmptyOrWhitespace(errors, plichtFelder[i], 
                		"required", "Value required.");
			}
        }


}
